*dv

recode sins* (1=.) (2=2) (3=3) (4=4) (5=5) (175=6)
alpha sins_1 sins_2 sins_3 sins_4 sins_5 sins_6 sins_7 sins_8 sins_9 sins_10 sins_11 sins_12 sins_13 sins_14 sins_15 sins_16 
pca sins_1 sins_2 sins_3 sins_4 sins_5 sins_6 sins_7 sins_8 sins_9 sins_10 sins_11 sins_12 sins_13 sins_14 sins_15 sins_16
egen sins=rowmean(sins_1 sins_2 sins_3 sins_4 sins_5 sins_6 sins_7 sins_8 sins_9 sins_10 sins_11 sins_12 sins_13 sins_14 sins_15 sins_16)

gen dv = 1
replace dv = . if (sins==.)

*controls

recode job_satis_5 (1=5) (2=4) (3=3) (4=2) (5=1), gen(job_satis_5r)
alpha job_satis_1 job_satis_2 job_satis_3 job_satis_4 job_satis_5r
egen job_satis=rowmean(job_satis_1 job_satis_2 job_satis_3 job_satis_4 job_satis_5r)

alpha status_1 status_2 status_3 status_4 status_5
egen status=rowmean(status_1 status_2 status_3 status_4 status_5)

alpha power_1 power_2 power_3 power_4 power_5
egen power = rowmean(power_1 power_2 power_3 power_4 power_5)

alpha panas_1 panas_2 panas_3 panas_4 panas_5 panas_6 panas_7 panas_8 panas_9 panas_10
egen pa=rowmean(panas_1 panas_2 panas_3 panas_4 panas_5 panas_6 panas_7 panas_8 panas_9 panas_10)

alpha panas_11 panas_12 panas_13 panas_14 panas_15 panas_16 panas_17 panas_18 panas_19 panas_20
egen na=rowmean(panas_11 panas_12 panas_13 panas_14 panas_15 panas_16 panas_17 panas_18 panas_19 panas_20)

*correlations and statistics table
format sins motive_3 age power status pa na job_satis religious %08.2f
sum sins motive_3 age power status pa na job_satis religious if !missing(dv), format
corr sins motive_3 age power status pa na job_satis religious if !missing(dv), format
pwcorr sins motive_3 age power status pa na job_satis religious if !missing(dv), sig

* sample characteristics
tab sex if !missing(dv)
gen age_y=age+18
sum sex age_y work_exp org_size if !missing(dv)
tab industry  if !missing(dv)

*analysis: movtive_3 as IV
reg sins c.motive_3##i.sex age power status pa na job_satis religious
margins, dydx(motive_3) at(sex=(0 1)) vsquish

sum motive_3 if (dv==1)
global Hmotive_3=r(mean)+r(sd)
global Lmotive_3=r(mean)-r(sd)

margins, dydx(sex) at(motive_3=($Hmotive_3 $Lmotive_3)) vsquish

